NOTE: This Technical Note has been retired. Please see the Technical Notes page for current documentation.

Technical Note PT05
MPW C Functions: To declare or not to declare, that is the question.

CONTENTS

Here's the low-down on when C functions need not be declared in include files.

[Nov 01 1987]






"The include files are all screwed up!"

This is a common misconception people have when they look through the MPW C include files. People report that the declaration of a ROM or system call foo() has been mistakenly left out of this or that include file. Here's the low-down on when functions do not have to be declared in an include file.

Back to top

The Law

A C function does not need to be declared in an include file if it requires glue code and returns a short or long integer as a result.

Routines that require glue code include:

  • All routines that are marked [Not in ROM] in Inside Macintosh
  • All register based routines (Operating System routines)
  • All routines which have strings or points as arguments (and have mixed case spellings)

Back to top

References

MPW C Manual

Using Assembly Language

The C Programming Language, Kernighan & Ritchie

M.PT.CFuncArgs

Using Strings or Points as Arguments

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (56K).

Download



Developer Documentation | Technical Q&As | Development Kits | Sample Code